import {CreateRecordForm, RecordQueryParams, RecordType} from "@/api/record/types";
import http from "@/utils/http";
import {ListResponse} from "@/types";

/**
 *
 * @param params
 */
export const recordListApi = async (params: RecordQueryParams) => {
    const res = await http.post<ListResponse<RecordType>>("/v1/printRecord/list", params)
    return res.data
}

/**
 *
 * @param params
 */
export const createRecordApi = async (params: CreateRecordForm) => {
    const res = await http.post("/v1/printRecord", params)
    return res.data
}

/**
 *
 * @param id
 */
export const deleteRecordApi = async (id: number) => {
    const res = await http.delete(`/v1/printRecord/${id}`, {})
    return res.data
}